package com.example.demo.config;
import com.example.demo.model.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@Slf4j
@RestControllerAdvice
public class BlogException {
    @ExceptionHandler
    public Result handler(Exception e){
        log.error("发生异常: e",e);
        return Result.fail(e.getMessage());
    }
}
